Towards Formalizing Java ’ S Weak
نویسنده
چکیده
Weak references provide the programmer with limited control over the process of memory management. By using them, a programmer can make decisions based on previous actions that are taken by the garbage collector. Although this is often helpful, the outcome of a program using weak references is less predictable due to the nondeterminism they introduce in program evaluation. It is therefore desirable to have a framework of formal tools to reason about weak references and programs that use them. We present several calculi that formalize various aspects of weak references, inspired by their implementation in Java. We provide a calculus to model multiple levels of non-strong references, where a different garbage collection policy is applied to each level. We consider different collection policies such as eager collection and lazy collection. Similar to the way they are implemented in Java, we give the semantics of eager collection to weak references and the semantics of lazy collection to soft references. Moreover, we condition garbage collection on the availability of time and space resources. While time constraints are used in order to restrict garbage collection, space constraints are used in order to trigger it. Finalizers are a problematic feature in Java, especially when they interact with weak references. We provide a calculus to model finalizer evaluation. Since finalizers have little meaning in a language without side-effect, we introduce a limited form of side effect into the calculus. We discuss determinism and the separate notion of uniqueness of (evaluation) outcome. We show that in our calculus, finalizer evaluation does not affect uniqueness of outcome.
منابع مشابه
Towards Formalizing the Java Security Architecture of JDK
The Java security architecture in the Java Development Kit 1.2 expands the current Java sandbox model, allowing ner-grained, congurable access control for Java code. This new security architecture permits more precise, yet exible, protection for both remote code (loaded across a network connection) and local code (residing on the same machine running the Java Virtual Machine) developed using th...
متن کاملTowards Formalizing the Java Security Architecture of JDK 1.2
The Java security architecture in the Java Development Kit 1.2 expands the current Java sandbox model, allowing ner-grained, congurable access control for Java code. This new security architecture permits more precise, yet exible, protection for both remote code (loaded across a network connection) and local code (residing on the same machine running the Java Virtual Machine) developed using th...
متن کاملTowards Categorizing and Formalizing the JDK API
Formal specification of correct library usage is extremely useful, both for software developers and for the formal analysis tools they use, such as model checkers or runtime monitoring systems. Unfortunately, the process of creating formal specifications is time consuming, and, for the most part, even the libraries in greatest use, such as the Java Development Kit (JDK) standard library, are le...
متن کاملDifference Effectiveness of Progressive Muscle Relaxation Therapy and Endorphin Massage Therapy towards Reducing Menstrual Pain Intensity in Adolescents
Background: Problems that arise during menstruation include pain before or during menstruation. Progressive Muscle Relaxation (PMR) techniques and Endorphin Massage (EM) therapy have been shown to be effective in controlling menstrual pain. The purpose of this study was to determine the difference in the effectiveness of pain intensity carried out by PMR therapy and EM therapy. Methods: Quasi...
متن کامل. L O ] 3 N ov 2 01 1 Formalizing set theory in weak logics , searching for
We show that first-order logic can be translated into a very simple and weak logic, and thus set theory can be formalized in this weak logic. This weak logical system is equivalent to the equational theory of Boolean algebras with three commuting complemented closure operators, i.e., that of diagonal-free 3-dimensional cylindric algebras (Df3’s). Equivalently, set theory can be formulated in pr...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007